package com.uzai.console.web.sop;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.uzai.console.annotation.SystemLogType;
import com.uzai.console.dto.sop.soptaskaddinfo.SopTaskAddInfoIdDto;
import com.uzai.console.dto.sop.soptaskaddinfo.SopTaskAddInfoIdListDto;
import com.uzai.console.dto.sop.soptaskaddinfo.SopTaskAddInfoQuery;
import com.uzai.console.enums.OperationTypeEnum;
import com.uzai.console.enums.SystemModelEnum;
import com.uzai.console.service.sop.SopTaskAddInfoService;
import com.uzai.console.vo.sop.soptaskaddinfo.SopTaskAddInfoVo;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 清理SOP任务明细记录任务
 * @author liuqi
 * @date 2021年08月16日 15:11
 */
@Api(value = "SOP任务明细记录",tags = "客服维护|SOP任务明细记录")
@ApiSort(31)
@RestController
public class SopAddInfoController extends BaseController {
    private Logger logger = LoggerFactory.getLogger(SopAddInfoController.class);

    @Autowired
    private SopTaskAddInfoService sopTaskAddInfoService;

    @ApiOperation(value = "分页查询SOP任务添加明细记录列表", notes = "分页查询SOP任务添加明细记录列表", response = SopTaskAddInfoVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/sopTaskAddInfo/findByPage")
    public Object findSopTaskAddInfoPage(@RequestBody SopTaskAddInfoQuery sopTaskAddInfoQuery){
        return sopTaskAddInfoService.findSopTaskAddInfoList(sopTaskAddInfoQuery);
    }

    @ApiOperation(value = "查询SOP任务添加明细记录任务详情", notes = "查询SOP任务添加明细记录任务详情", response = SopTaskAddInfoVo.class)
    @ApiOperationSupport(order = 2)
    @PostMapping("/sopTaskAddInfo/findById")
    public Object findSopTaskAddInfo(@RequestBody SopTaskAddInfoIdDto sopTaskAddInfoIdDto){
        return sopTaskAddInfoService.findSopTaskAddInfo(sopTaskAddInfoIdDto);
    }

    @SystemLogType(model = SystemModelEnum.SopTaskAddInfo, type = OperationTypeEnum.DELETE)
    @ApiOperation(value = "批量删除SOP任务添加明细记录", notes = "批量删除SOP任务添加明细记录")
    @ApiOperationSupport(order = 3)
    @PostMapping("/sopTaskAddInfo/batchDelete")
    public Object batchDeleteSopTaskAddInfo(@RequestBody SopTaskAddInfoIdListDto sopTaskAddInfoIdListDto){
        sopTaskAddInfoService.batchDeleteSopTaskAddInfo(sopTaskAddInfoIdListDto);
        return true;
    }

}
